#ifndef WINDOWMANAGER_H
#define WINDOWMANAGER_H
#include <QApplication>
#include "LoginWindow.h"
#include "PeopleWindow.h"
#include "KeyGetWindow.h"
#include "NotifWindow.h"
#include "ChoiceWindow.h"
#include "ChatWindow.h"
class WindowManager: public QApplication
{
    static WindowManager* mInstance;
    list<BaseWindow*> mWindowList;
    public:
    enum WindowType{LOGINWINDOW,PEOPLEWINDOW,REGISTERWINDOW,CHATWINDOW,PROFILEWINDOW,NOTIFWINDOW,KEYGETWINDOW,CHOICE_WINDOW,FINDWINDOW};

    static WindowManager* GetInstance(){return mInstance;}
    explicit WindowManager(int& argc,char** argv);
    ~WindowManager();

    BaseWindow* ShowWindow(WindowType type,void* data=0);
    void CloseWindow(WindowType type);
    void DoCommand(WindowType type,QString command,void* data=0);
    bool event(QEvent *);
     void RemoveWindow(BaseWindow* win);
     BaseWindow* GetWindow(WindowType type);

};


#endif // WINDOWMANAGER_H
